const cloudbase = require("@cloudbase/node-sdk");
const app = cloudbase.init({
    env: cloudbase.SYMBOL_CURRENT_ENV
});

const db = app.database();
// 获取购物车列表
exports.main = async (event, context) => {
    const collection = db.collection("cart");
    const res = await collection.aggregate().lookup({
            from: 'shoes',
            localField: 'goods_id',
            foreignField: '_id',
            as: 'shoes_info'
        })
        .end()
    return res.data;
};